package com.nacos.example;

import com.alibaba.nacos.api.annotation.NacosProperties;
import com.alibaba.nacos.spring.context.annotation.config.EnableNacosConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @author wy
 * @date 2022/04/24
 * @description 各种获取配置文件和nacos热更新
 **/
@SpringBootApplication
// 增加@EnableNacosConfig才能使用@NacosValue注解和@NacosConfigurationProperties注解获取nacos配置中心的配置文件内容
@EnableNacosConfig(globalProperties = @NacosProperties(serverAddr = "127.0.0.1:8848"))
public class ConfigApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConfigApplication.class, args);
    }
}
